Skip to content

chore: add .npmrc with supply chain protection#243

Merged
zainfathoni merged 1 commit intomainfrom
chore/supply-chain-protection
Apr 1, 2026
Merged

chore: add .npmrc with supply chain protection#243
zainfathoni merged 1 commit intomainfrom
chore/supply-chain-protection

Conversation

@zainfathoni
Copy link
Copy Markdown
Owner

What

Adds .npmrc with supply chain protection settings:

  • save-exact=true — pin exact versions instead of semver ranges (^x.y.z)
  • min-release-age=7 — quarantine newly published packages for 7 days

Why

In response to the axios supply chain attack (2026-03-31), where a compromised axios@1.14.1 pulled in malicious plain-crypto-js@4.2.1 published minutes before.

Note

npm 11 shows a warning about min-release-age being unknown — this config may not be enforced until npm 12. A separate migration to pnpm is tracked in #242, which has full support for this feature (minimum-release-age in minutes).

Impact

  • save-exact works immediately
  • min-release-age will take effect once npm fully supports it (or after pnpm migration)
  • Existing lockfile is unaffected

- save-exact=true: pin exact versions instead of semver ranges
- min-release-age=7: quarantine newly published packages for 7 days

Ref: axios supply chain attack (axios@1.14.1 / plain-crypto-js@4.2.1)
@zainfathoni zainfathoni merged commit 8501a5a into main Apr 1, 2026
8 checks passed
@zainfathoni zainfathoni deleted the chore/supply-chain-protection branch April 1, 2026 05:02
@wheeljackz wheeljackz restored the chore/supply-chain-protection branch April 2, 2026 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants